package com.qingcloud.adminbackend.enums;

/**
 * 设备编号批次状态
 */
public enum EidBatchStatusEnum {

    USE(1, "已使用"),
    NO_USE(2, "未使用"),
    CANCEL(3, "作废");

    public int code;

    public String name;

    EidBatchStatusEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByCode(int code) {
        EidBatchStatusEnum[] uss = values();
        for (EidBatchStatusEnum us : uss) {
            if (us.code == code) {
                return us.name;
            }
        }
        return null;
    }
}
